import axios from '@/config/httpConfig'
import config from '@/config/baseUrl'



//登录
export function login() {
	let formdata = new FormData()
	formdata.append("username","admin");
	formdata.append("password","admin123");
	return axios.get(`/app/v1/video/20`)
}

//获取短视频列表
export function getShortList(data) {
	return axios.get('/app/v1/short/list',data)
}



//获取分类
export function getCategoryList(data) {
	return axios.get(`/app/v1/category/list`, data)
}


//轮播图列表
export function getBannerList(data) {
	return axios.get(`/app/v1/banner/list`, data)
}

//获取短Token
export function getVideoToken(data) {
	return axios.get(`/app/v1/video/upToken`,data)
}

export function getImageToken(data){
	return axios.get(`/app/v1/video/upToken?bucket=${config.qinNiuBucket}`,data)
}

//提交转码请求
export function setVideoPfop(data) {
	return axios.post(`/app/v1/video/pfop`,data)
}

//查询转码请求
export function getVideoPfopStatus(data) {
	return axios.get(`/app/v1/video/pfop/status`,data)
}


//获取短视频列表

export function getVideoList(data) {
	return axios.get(`/app/v1/video/list`, data)
}

//保存视频文件

export function setShortSave(data) {
	return axios.post(`/app/v1/short/save`, data)
}


//获取视频详情

export function getVideoInfo(data) {
	return axios.get(`/app/v1/video/detail/${data.id}`)
}

//获取短视频详情

export function getShortInfo(data) {
	return axios.get(`/app/v1/short/detail/${data.id}`)
}

//身份认证代码


export function getOauthInit(data) {
	return axios.get(`/oauth/init?jumpUrl=${data.url}`)
}


export function delShort(data) {
	return axios.put(`/app/v1/short/${data.id}/delete`)
}



export function getActivityInfo(data) {
	return axios.get(`/app/v1/activity/${data.id}`)
}

export function setActivity(data){
	return axios.post(`/app/v1/activity/detail/upload`,data)
}